Skip to content

App: several failures say only "That didn't work. Try again." - #821

Closed
itz4blitz wants to merge 1 commit into
mainfrom
issue/765-error-text
Closed

itz4blitz wants to merge 1 commit into
mainfrom
issue/765-error-text

Conversation

@itz4blitz

Copy link
Copy Markdown
Collaborator

What changed and why

A failure that used to say only "That didn't work. Try again." now names the action and a short ref, such as "Couldn't send that. Try again. (ref 7F3A)." The log line with that ref has the real error and how many times that fallback has happened. Copy diagnostics lists the recent refs, the action, and the count, and leaves the error text in the log. A network's own reason is still shown as sent. The bare sentence is not. A call answer that is not an error says the call could not be placed.

Tested with cargo test -p tinyclient --features gui --bins and cargo test -p chatd --lib a_missing_error_names_the_call. The new wording tests pass. One existing test, the second-launch invite pipe, could not take the primary pipe because another process already holds it. It is not part of this change. cargo clippy -p tinyclient --features gui --all-targets still stops on a pre-existing empty range in the composer. The files in this change added no new clippy warnings.

The proof is TINYCLIENT_PROVE=error-text in the desktop binary, before the window opens. It fails unless a fallback names the action, carries a ref, and drops the bare sentence. A build from before this change ignores the variable and opens the window, so the driver fails there.

New protocol error codes, and the Tiny live socket's own fallback sentence, are unchanged. Those sit in the protocol crate and in adapters.

Type

  • feature
  • fix
  • perf
  • refactor
  • chore
  • docs

Platforms

  • windows
  • macos
  • linux
  • android
  • ios

Proof

Scenario: e2e/scenarios/error-text

Lab run: not run. The lab was not started for this pull request.

Compatibility

No protocol change. An older server still works. The sentences are local.

Risk and rollback

A person could see the wrong action name, or a ref that is not in the log. Revert this commit.

Release note

A failure names what was tried and a short ref you can quote.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Tiny Code Review

⚠️ Code review unavailable · run

the AI provider rate-limited the request

This is advice, not a gate. Re-run with the agent:review label or a /review comment.

@unRekable unRekable left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

🟡 1 finding (0 blocking).

The PR replaces the bare try-again fallbacks with sentences that name the action and carry a short ref, keeps a bounded recent-fallback list for Copy diagnostics, and gives chatd's call fallback its own words. Compatibility holds: no protocol type changes, and is_bare covers every bare sentence chatd still emits, so an older server's bare detail is replaced on the client. One real issue: the new fallback log line carries the raw error display, which the removed doc line on this same function explicitly never logged; a decode-failed frame's serde error can embed payload text and reaches the log under a field name the log redactor does not deny.

Residual risk

  • quote_code hashes only the action and the class, and every refusal fallback uses the class "refused", so different codes for the same action share one ref: note_fallback merges their hit counts and several log lines with different causes carry the same ref, so the UI ref does not pin down the real error.
  • is_bare is an exact-string list; a future bare fallback sentence added in chatd would be shown to the user as sent until the list here is updated in lockstep.
  • The is_gone, is_slow and is_other_version branches still log "action failed" without a ref, so a user who quotes only those sentences gives support nothing to grep for.

OTHER_ANSWER.to_owned()
} else {
"That didn't work. Try again.".to_owned()
with_ref(op, failure_class(err), &err.to_string(), &format!("Couldn't {}. Try again.", action_phrase(op)))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Major: This reverses the function's own removed rule ("never the error's display"): with_ref logs cause = %cause into the operator log and the debug ring under a field name (cause) that is not on log_policy's DENY list, and protocol::redact strips credentials but not message text. ask()'s errors come from protocol::read_frame, which maps a failed serde_json decode of a whole Response frame into the io error, and a serde Display can embed payload snippets (invalid type: string "..."), so text from a decode-failed frame can land in logs and exported debug bundles. Log the error's kind, not its display; the ref plus failure_class is enough for support.

Suggested change
with_ref(op, failure_class(err), &err.to_string(), &format!("Couldn't {}. Try again.", action_phrase(op)))
with_ref(op, failure_class(err), &format!("{:?}", err.kind()), &format!("Couldn't {}. Try again.", action_phrase(op)))

A request that fails for no specific reason says what was tried and a short ref. The same ref is in the log with the real error, and Copy diagnostics lists recent refs. A call that comes back without an error says it could not be placed.

Closes #765
@itz4blitz

Copy link
Copy Markdown
Collaborator Author

Superseded by and merged in #903 (d387971 — Release 2026-11-20 combined PR).

@itz4blitz itz4blitz closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants